package com.service.impl;

import com.dao.UserDao;
import com.entity.User;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with LXD
 *
 * @author:Luhui
 * @qq:729913162
 * @Date:2018-07-22
 * @Time:20:13
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    public boolean register(User user) {
        return userDao.addUser(user)==1;
    }

    public User login(User user) {
        return userDao.findOne(user);
    }

    public boolean updUser(User user) {
        return userDao.updUser(user)==1;
    }

    public User findUserById(int id) {
        return userDao.findUserById(id);
    }


}
